a#logout.btn.blue(href='/logout') Logout

h2 Stats

- if (my_stats.total_games === 0)
  .error You didn't play any game yet
- else
  table.stats(cellpadding='0', cellspacing='0')
    thead
      tr
        th Avg Time
        th % Finished
        th Avg Puntuation
        th Games played

      tbody
        tr
          td= humanize_time(Math.round(my_stats.total_time / my_stats.total_games))
          td= Math.round(my_stats.finished_games * 100 / my_stats.total_games, 2)
          td= Math.round(my_stats.total_puntuation / my_stats.total_games)
          td= my_stats.total_games

.separator

h2 Scores
br

- if (stats.length)
  ul.scores
    - each stat, i in stats
      - if (i <= 9)
        - var rank = i + 1
      - else
        - if(i === 10 && num_better_scores > 15)
          li ...
        - var rank = num_better_scores - index + i - 10

      li.score(class= stat.user._id === user._id ? 'current' : '')
        strong.rank= rank
        img(src= stat.user.picture)
        div.info
          div.name= stat.user.name
          span.puntuation
            = stat.score.puntuation
            span.time= humanize_time(stat.score.time)
        div.when= moment(stat.score.updated_at).fromNow()
